home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58a.iso / extras / quake 3 source / Q3A_ToolSource.exe / Main / MainFrm.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-02  |  15.2 KB  |  470 lines

  1. // MainFrm.h : interface of the CMainFrame class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_)
  6. #define AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_
  7.  
  8. #if _MSC_VER >= 1000
  9. #pragma once
  10. #endif // _MSC_VER >= 1000
  11.  
  12. #include "LstToolBar.h"
  13. #include "XYWnd.h"
  14. #include "TexWnd.h"
  15. #include "ZWnd.h"
  16. #include "CamWnd.h"
  17. #include "RADEditWnd.h"
  18. #include "TextureBar.h"
  19. #include "PlugInManager.h"
  20. #include "PlugIn.h"
  21. #include "groupdlg.h"
  22.  
  23.  
  24. const int RAD_SHIFT =   0x01;
  25. const int RAD_ALT =     0x02;
  26. const int RAD_CONTROL = 0x04;
  27. const int RAD_PRESS   = 0x08;
  28.  
  29. struct SCommandInfo
  30. {
  31.   char* m_strCommand;
  32.   unsigned int   m_nKey;
  33.   unsigned int   m_nModifiers;
  34.   unsigned int m_nCommand;
  35. };
  36.  
  37. struct SKeyInfo
  38. {
  39.   char* m_strName;
  40.   unsigned int m_nVKKey;
  41. };
  42.  
  43.  
  44.  
  45.  
  46. class CMainFrame : public CFrameWnd
  47. {
  48.     DECLARE_DYNAMIC(CMainFrame)
  49. public:
  50.     CMainFrame();
  51.   void HandleKey(UINT nChar, UINT nRepCnt, UINT nFlags, bool bDown = true) 
  52.   {
  53.     if (bDown)
  54.       OnKeyDown(nChar, nRepCnt, nFlags);
  55.     else
  56.       OnKeyUp(nChar, nRepCnt, nFlags);
  57.   };
  58.  
  59. // Attributes
  60. public:
  61.  
  62. // Operations
  63. public:
  64.  
  65. // Overrides
  66.     // ClassWizard generated virtual function overrides
  67.     //{{AFX_VIRTUAL(CMainFrame)
  68.     public:
  69.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  70.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  71.     protected:
  72.     virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  73.     virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  74.     virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  75.     virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
  76.     //}}AFX_VIRTUAL
  77.  
  78. // Implementation
  79. public:
  80.   void UpdatePatchToolbarButtons();
  81.   void NudgeSelection(int nDirection, int nAmount);
  82.     void UpdateTextureBar();
  83.   void SetButtonMenuStates();
  84.     void SetTexValStatus();
  85.     void SetGridStatus();
  86.     void RoutineProcessing();
  87.     CXYWnd* ActiveXY();
  88.     void UpdateWindows(int nBits);
  89.     void SetStatusText(int nPane, const char* pText);
  90.     void UpdateStatusText();
  91.     void SetWindowStyle(int nStyle);
  92.     virtual ~CMainFrame();
  93.   CXYWnd* GetXYWnd() {return m_pXYWnd;};
  94.   CXYWnd* GetXZWnd() {return m_pXZWnd;};
  95.   CXYWnd* GetYZWnd() {return m_pYZWnd;};
  96.   CCamWnd* GetCamera() {return m_pCamWnd;};
  97.   CTexWnd* GetTexWnd() {return m_pTexWnd;};
  98.   void SetActiveXY(CXYWnd* p) 
  99.   {
  100.     if (m_pActiveXY)
  101.       m_pActiveXY->SetActive(false);
  102.  
  103.     m_pActiveXY = p;
  104.  
  105.     if (m_pActiveXY)
  106.       m_pActiveXY->SetActive(true);
  107.  
  108.   };
  109.   int CurrentStyle() { return m_nCurrentStyle; };
  110. #ifdef _DEBUG
  111.     virtual void AssertValid() const;
  112.     virtual void Dump(CDumpContext& dc) const;
  113. #endif
  114.  
  115. protected:  // control bar embedded members
  116.     CStatusBar  m_wndStatusBar;
  117.     CLstToolBar m_wndToolBar;
  118.     CLstToolBar m_wndScaleBar;
  119.     CDialogBar m_wndHelpBar;
  120.     CTextureBar m_wndTextureBar;
  121.   CSplitterWnd m_wndSplit;
  122.   CSplitterWnd m_wndSplit2;
  123.   CSplitterWnd m_wndSplit3;
  124.   CXYWnd* m_pXYWnd;
  125.   CXYWnd* m_pYZWnd;
  126.   CXYWnd* m_pXZWnd;
  127.   CCamWnd* m_pCamWnd;
  128.   CTexWnd* m_pTexWnd;
  129.   CZWnd* m_pZWnd;
  130.   CRADEditWnd* m_pEditWnd;
  131.   int m_nCurrentStyle;
  132.   CString m_strStatus[15];
  133.   CXYWnd* m_pActiveXY;
  134.   bool m_bCamPreview;
  135.   CPlugInManager m_PlugInMgr;
  136.   int m_nNextPlugInID;
  137.  
  138. // Generated message map functions
  139. protected:
  140.     bool m_bDoLoop;
  141.     bool m_bSplittersOK;
  142.     void CreateQEChildren();
  143.       void LoadCommandMap();
  144.     void ShowMenuItemKeyBindings(CMenu *pMenu);
  145.       void SetEntityCheck();
  146.     afx_msg void OnBSPStatus(UINT wParam, long lParam);
  147.     afx_msg void OnBSPDone(UINT wParam, long lParam);
  148. public:
  149.     void Nudge(int nDim, float fNudge);
  150.  
  151.       CPlugInManager &GetPlugInMgr() {return m_PlugInMgr;};
  152.       void AddPlugInMenuItem(CPlugIn* pPlugIn);
  153.     void CleanPlugInMenu();
  154.  
  155.   // these are public so i can easily reflect messages
  156.   // from child windows..
  157.     //{{AFX_MSG(CMainFrame)
  158.     afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  159.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  160.     afx_msg void OnTimer(UINT nIDEvent);
  161.     afx_msg void OnDestroy();
  162.     afx_msg void OnClose();
  163.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  164.     afx_msg void OnSize(UINT nType, int cx, int cy);
  165.     afx_msg void ToggleCamera();
  166.     afx_msg void OnFileClose();
  167.     afx_msg void OnFileExit();
  168.     afx_msg void OnFileLoadproject();
  169.     afx_msg void OnFileNew();
  170.     afx_msg void OnFileOpen();
  171.     afx_msg void OnFilePointfile();
  172.     afx_msg void OnFilePrint();
  173.     afx_msg void OnFilePrintPreview();
  174.     afx_msg void OnFileSave();
  175.     afx_msg void OnFileSaveas();
  176.     afx_msg void OnView100();
  177.     afx_msg void OnViewCenter();
  178.     afx_msg void OnViewConsole();
  179.     afx_msg void OnViewDownfloor();
  180.     afx_msg void OnViewEntity();
  181.     afx_msg void OnViewFront();
  182.     afx_msg void OnViewShowblocks();
  183.     afx_msg void OnViewShowclip();
  184.     afx_msg void OnViewShowcoordinates();
  185.     afx_msg void OnViewShowdetail();
  186.     afx_msg void OnViewShowent();
  187.     afx_msg void OnViewShowlights();
  188.     afx_msg void OnViewShownames();
  189.     afx_msg void OnViewShowpath();
  190.     afx_msg void OnViewShowwater();
  191.     afx_msg void OnViewShowworld();
  192.     afx_msg void OnViewTexture();
  193.     afx_msg void OnViewUpfloor();
  194.     afx_msg void OnViewXy();
  195.     afx_msg void OnViewZ100();
  196.     afx_msg void OnViewZoomin();
  197.     afx_msg void OnViewZoomout();
  198.     afx_msg void OnViewZzoomin();
  199.     afx_msg void OnViewZzoomout();
  200.     afx_msg void OnViewSide();
  201.     afx_msg void OnTexturesShowinuse();
  202.     afx_msg void OnTexturesInspector();
  203.     afx_msg void OnMiscBenchmark();
  204.     afx_msg void OnMiscFindbrush();
  205.     afx_msg void OnMiscGamma();
  206.     afx_msg void OnMiscNextleakspot();
  207.     afx_msg void OnMiscPreviousleakspot();
  208.     afx_msg void OnMiscPrintxy();
  209.     afx_msg void OnMiscSelectentitycolor();
  210.     afx_msg void OnTexturebk();
  211.     afx_msg void OnColorsMajor();
  212.     afx_msg void OnColorsMinor();
  213.     afx_msg void OnColorsXybk();
  214.     afx_msg void OnBrush3sided();
  215.     afx_msg void OnBrush4sided();
  216.     afx_msg void OnBrush5sided();
  217.     afx_msg void OnBrush6sided();
  218.     afx_msg void OnBrush7sided();
  219.     afx_msg void OnBrush8sided();
  220.     afx_msg void OnBrush9sided();
  221.     afx_msg void OnBrushArbitrarysided();
  222.     afx_msg void OnBrushFlipx();
  223.     afx_msg void OnBrushFlipy();
  224.     afx_msg void OnBrushFlipz();
  225.     afx_msg void OnBrushRotatex();
  226.     afx_msg void OnBrushRotatey();
  227.     afx_msg void OnBrushRotatez();
  228.     afx_msg void OnRegionOff();
  229.     afx_msg void OnRegionSetbrush();
  230.     afx_msg void OnRegionSetselection();
  231.     afx_msg void OnRegionSettallbrush();
  232.     afx_msg void OnRegionSetxy();
  233.     afx_msg void OnSelectionArbitraryrotation();
  234.     afx_msg void OnSelectionClone();
  235.     afx_msg void OnSelectionConnect();
  236.     afx_msg void OnSelectionCsgsubtract();
  237.     afx_msg void OnSelectionCsgmerge();
  238.     afx_msg void OnSelectionNoOutline();
  239.     afx_msg void OnSelectionDelete();
  240.     afx_msg void OnSelectionDeselect();
  241.     afx_msg void OnSelectionDragedges();
  242.     afx_msg void OnSelectionDragvertecies();
  243.     afx_msg void OnSelectionMakeDetail();
  244.     afx_msg void OnSelectionMakeStructural();
  245.     afx_msg void OnSelectionMakehollow();
  246.     afx_msg void OnSelectionSelectcompletetall();
  247.     afx_msg void OnSelectionSelectinside();
  248.     afx_msg void OnSelectionSelectpartialtall();
  249.     afx_msg void OnSelectionSelecttouching();
  250.     afx_msg void OnSelectionUngroupentity();
  251.     afx_msg void OnTexturesPopup();
  252.     afx_msg void OnPopupSelection();
  253.     afx_msg void OnViewChange();
  254.     afx_msg void OnViewCameraupdate();
  255.     afx_msg void OnUpdateViewCameraupdate(CCmdUI* pCmdUI);
  256.     afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
  257.     afx_msg void OnHelpAbout();
  258.     afx_msg void OnViewClipper();
  259.     afx_msg void OnCameraAngledown();
  260.     afx_msg void OnCameraAngleup();
  261.     afx_msg void OnCameraBack();
  262.     afx_msg void OnCameraDown();
  263.     afx_msg void OnCameraForward();
  264.     afx_msg void OnCameraLeft();
  265.     afx_msg void OnCameraRight();
  266.     afx_msg void OnCameraStrafeleft();
  267.     afx_msg void OnCameraStraferight();
  268.     afx_msg void OnCameraUp();
  269.     afx_msg void OnGridToggle();
  270.     afx_msg void OnPrefs();
  271.     afx_msg void OnTogglecamera();
  272.     afx_msg void OnToggleconsole();
  273.     afx_msg void OnToggleview();
  274.     afx_msg void OnTogglez();
  275.     afx_msg void OnToggleLock();
  276.     afx_msg void OnEditMapinfo();
  277.     afx_msg void OnEditEntityinfo();
  278.     afx_msg void OnBrushScripts();
  279.     afx_msg void OnViewNextview();
  280.     afx_msg void OnHelpCommandlist();
  281.     afx_msg void OnFileNewproject();
  282.     afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
  283.     afx_msg void OnFlipClip();
  284.     afx_msg void OnClipSelected();
  285.     afx_msg void OnSplitSelected();
  286.     afx_msg void OnToggleviewXz();
  287.     afx_msg void OnToggleviewYz();
  288.     afx_msg void OnColorsBrush();
  289.     afx_msg void OnColorsClipper();
  290.     afx_msg void OnColorsGridtext();
  291.     afx_msg void OnColorsSelectedbrush();
  292.     afx_msg void OnColorsGridblock();
  293.     afx_msg void OnColorsViewname();
  294.     afx_msg void OnColorSetoriginal();
  295.     afx_msg void OnColorSetqer();
  296.     afx_msg void OnColorSetblack();
  297.     afx_msg void OnSnaptogrid();
  298.     afx_msg void OnSelectScale();
  299.     afx_msg void OnSelectMouserotate();
  300.     afx_msg void OnEditCopybrush();
  301.     afx_msg void OnEditPastebrush();
  302.     afx_msg void OnEditUndo();
  303.     afx_msg void OnEditRedo();
  304.     afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
  305.     afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
  306.     afx_msg void OnSelectionInvert();
  307.     afx_msg void OnSelectionTextureDec();
  308.     afx_msg void OnSelectionTextureFit();
  309.     afx_msg void OnSelectionTextureInc();
  310.     afx_msg void OnSelectionTextureRotateclock();
  311.     afx_msg void OnSelectionTextureRotatecounter();
  312.     afx_msg void OnSelectionTextureScaledown();
  313.     afx_msg void OnSelectionTextureScaleup();
  314.     afx_msg void OnSelectionTextureShiftdown();
  315.     afx_msg void OnSelectionTextureShiftleft();
  316.     afx_msg void OnSelectionTextureShiftright();
  317.     afx_msg void OnSelectionTextureShiftup();
  318.     afx_msg void OnGridNext();
  319.     afx_msg void OnGridPrev();
  320.     afx_msg void OnSelectionTextureScaleLeft();
  321.     afx_msg void OnSelectionTextureScaleRight();
  322.     afx_msg void OnTextureReplaceall();
  323.     afx_msg void OnScalelockx();
  324.     afx_msg void OnScalelocky();
  325.     afx_msg void OnScalelockz();
  326.     afx_msg void OnSelectMousescale();
  327.     afx_msg void OnViewCubicclipping();
  328.     afx_msg void OnFileImport();
  329.     afx_msg void OnFileProjectsettings();
  330.     afx_msg void OnUpdateFileImport(CCmdUI* pCmdUI);
  331.     afx_msg void OnViewCubein();
  332.     afx_msg void OnViewCubeout();
  333.     afx_msg void OnFileSaveregion();
  334.     afx_msg void OnUpdateFileSaveregion(CCmdUI* pCmdUI);
  335.     afx_msg void OnSelectionMovedown();
  336.     afx_msg void OnSelectionMoveup();
  337.     afx_msg void OnToolbarMain();
  338.     afx_msg void OnToolbarTexture();
  339.     afx_msg void OnSelectionPrint();
  340.     afx_msg void OnSelectionTogglesizepaint();
  341.     afx_msg void OnBrushMakecone();
  342.     afx_msg void OnTexturesLoad();
  343.     afx_msg void OnToggleRotatelock();
  344.     afx_msg void OnCurveBevel();
  345.     afx_msg void OnCurveCylinder();
  346.     afx_msg void OnCurveEighthsphere();
  347.     afx_msg void OnCurveEndcap();
  348.     afx_msg void OnCurveHemisphere();
  349.     afx_msg void OnCurveInvertcurve();
  350.     afx_msg void OnCurveQuarter();
  351.     afx_msg void OnCurveSphere();
  352.     afx_msg void OnFileImportmap();
  353.     afx_msg void OnFileExportmap();
  354.     afx_msg void OnEditLoadprefab();
  355.     afx_msg void OnViewShowcurves();
  356.     afx_msg void OnSelectionSelectNudgedown();
  357.     afx_msg void OnSelectionSelectNudgeleft();
  358.     afx_msg void OnSelectionSelectNudgeright();
  359.     afx_msg void OnSelectionSelectNudgeup();
  360.     afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  361.     afx_msg void OnTexturesLoadlist();
  362.     afx_msg void OnDontselectcurve();
  363.     afx_msg void OnConvertcurves();
  364.     afx_msg void OnDynamicLighting();
  365.     afx_msg void OnCurveSimplepatchmesh();
  366.     afx_msg void OnPatchToggleBox();
  367.     afx_msg void OnPatchWireframe();
  368.     afx_msg void OnCurvePatchcone();
  369.     afx_msg void OnCurvePatchtube();
  370.     afx_msg void OnPatchWeld();
  371.     afx_msg void OnCurvePatchbevel();
  372.     afx_msg void OnCurvePatchendcap();
  373.     afx_msg void OnCurvePatchinvertedbevel();
  374.     afx_msg void OnCurvePatchinvertedendcap();
  375.     afx_msg void OnPatchDrilldown();
  376.     afx_msg void OnCurveInsertcolumn();
  377.     afx_msg void OnCurveInsertrow();
  378.     afx_msg void OnCurveDeletecolumn();
  379.     afx_msg void OnCurveDeleterow();
  380.     afx_msg void OnCurveInsertAddcolumn();
  381.     afx_msg void OnCurveInsertAddrow();
  382.     afx_msg void OnCurveInsertInsertcolumn();
  383.     afx_msg void OnCurveInsertInsertrow();
  384.     afx_msg void OnCurveNegative();
  385.     afx_msg void OnCurveNegativeTextureX();
  386.     afx_msg void OnCurveNegativeTextureY();
  387.     afx_msg void OnCurveDeleteFirstcolumn();
  388.     afx_msg void OnCurveDeleteFirstrow();
  389.     afx_msg void OnCurveDeleteLastcolumn();
  390.     afx_msg void OnCurveDeleteLastrow();
  391.     afx_msg void OnPatchBend();
  392.     afx_msg void OnPatchInsdel();
  393.     afx_msg void OnPatchEnter();
  394.     afx_msg void OnPatchTab();
  395.     afx_msg void OnCurvePatchdensetube();
  396.     afx_msg void OnCurvePatchverydensetube();
  397.     afx_msg void OnCurveCap();
  398.     afx_msg void OnCurveCapInvertedbevel();
  399.     afx_msg void OnCurveCapInvertedendcap();
  400.     afx_msg void OnCurveRedisperseCols();
  401.     afx_msg void OnCurveRedisperseRows();
  402.     afx_msg void OnPatchNaturalize();
  403.     afx_msg void OnSnapToGrid();
  404.     afx_msg void OnCurvePatchsquare();
  405.     afx_msg void OnTexturesTexturewindowscale10();
  406.     afx_msg void OnTexturesTexturewindowscale100();
  407.     afx_msg void OnTexturesTexturewindowscale200();
  408.     afx_msg void OnTexturesTexturewindowscale25();
  409.     afx_msg void OnTexturesTexturewindowscale50();
  410.     afx_msg void OnTexturesFlush();
  411.     afx_msg void OnCurveOverlayClear();
  412.     afx_msg void OnCurveOverlaySet();
  413.     afx_msg void OnCurveThicken();
  414.     afx_msg void OnCurveCyclecap();
  415.     afx_msg void OnCurveMatrixTranspose();
  416.     afx_msg void OnTexturesReloadshaders();
  417.     afx_msg void OnShowEntities();
  418.     afx_msg void OnViewEntitiesasBoundingbox();
  419.     afx_msg void OnViewEntitiesasSelectedskinned();
  420.     afx_msg void OnViewEntitiesasSelectedwireframe();
  421.     afx_msg void OnViewEntitiesasSkinned();
  422.     afx_msg void OnViewEntitiesasSkinnedandboxed();
  423.     afx_msg void OnViewEntitiesasWireframe();
  424.     afx_msg void OnPluginsRefresh();
  425.     afx_msg void OnViewShowhint();
  426.     afx_msg void OnUpdateTexturesShowinuse(CCmdUI* pCmdUI);
  427.     afx_msg void OnTexturesShowall();
  428.     afx_msg void OnPatchInspector();
  429.     afx_msg void OnViewOpengllighting();
  430.     afx_msg void OnSelectAll();
  431.     afx_msg void OnViewShowcaulk();
  432.   afx_msg void OnCurveFreeze();
  433.   afx_msg void OnCurveUnFreeze();
  434.   afx_msg void OnCurveUnFreezeAll();
  435.   afx_msg void OnSelectReselect();
  436.     afx_msg void OnViewShowangles();
  437.     afx_msg void OnEditSaveprefab();
  438.     afx_msg void OnCurveMoreendcapsbevelsSquarebevel();
  439.     afx_msg void OnCurveMoreendcapsbevelsSquareendcap();
  440.     afx_msg void OnBrushPrimitivesSphere();
  441.     afx_msg void OnViewCrosshair();
  442.     afx_msg void OnViewHideshowHideselected();
  443.     afx_msg void OnViewHideshowShowhidden();
  444.     afx_msg void OnTexturesShadersShow();
  445.     afx_msg void OnTexturesFlushUnused();
  446.     afx_msg void OnViewGroups();
  447.     afx_msg void OnDropGroupAddtoWorld();
  448.     afx_msg void OnDropGroupName();
  449.     afx_msg void OnDropGroupNewgroup();
  450.     afx_msg void OnDropGroupRemove();
  451.     //}}AFX_MSG
  452.   afx_msg void OnMru(unsigned int nID);
  453.   afx_msg void OnViewNearest(unsigned int nID);
  454.   afx_msg void OnTextureWad(unsigned int nID);
  455.   afx_msg void OnBspCommand(unsigned int nID);
  456.   afx_msg void OnGrid1(unsigned int nID);
  457.   afx_msg void OnDisplayChange(WPARAM wp, LPARAM lp);
  458.   void CheckTextureScale(int id);
  459.   afx_msg void OnPlugIn(unsigned int nID);
  460.  
  461.     DECLARE_MESSAGE_MAP()
  462. };
  463.  
  464. /////////////////////////////////////////////////////////////////////////////
  465.  
  466. //{{AFX_INSERT_LOCATION}}
  467. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  468.  
  469. #endif // !defined(AFX_MAINFRM_H__330BBF0A_731C_11D1_B539_00AA00A410FC__INCLUDED_)
  470.